home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Edition 10 / FreelogHS10.iso / Buzz / Buzz_Advanced_Pack.exe / {app} / Dev / Overloader - SuperDonut SongInf / songinfobase.h < prev    next >
C/C++ Source or Header  |  2001-11-06  |  2KB  |  49 lines

  1. /////////////////////////////////////////////////////////////////
  2. // Start of SongInfo OEB Stuff
  3. /////////////////////////////////////////////////////////////////
  4. // Use this set of routines for your songinfo machine
  5. char myappdir[250];
  6. class CSongInfoHandler {
  7. public:
  8.     virtual void OpenSIDialog();
  9.     virtual char * GetSongInfoName();
  10.     virtual void GetTags(int tag_id, char *tagdata);
  11. };
  12. int library_loaded;
  13. char *(__cdecl *oeblib_GetVersion)(void);
  14. HWND (__cdecl *oeblib_GetMainBuzzWindow)(void);
  15. void (__cdecl *oeblib_SetSongInfoMac)(CSongInfoHandler *);
  16. CSongInfoHandler *(__cdecl *oeblib_GetSongInfoMac)(void);
  17. void (__cdecl *oeblib_SetpCB)(void *);
  18. void *(__cdecl *oeblib_GetpCB)(void);
  19. void LoadOEBForSongInfo(HINSTANCE dllInst) {
  20.     char baba[256], baba2[256];
  21.     char thestrdata[200];
  22.     char *filen;
  23.     GetModuleFileName(dllInst,baba,256);
  24.     GetFullPathName(baba,256,baba2,&filen);
  25.     sprintf(filen,"\0");
  26.     sprintf(&baba2[(int)(strlen(baba2) - 2 - 12)],"\0");
  27.     sprintf(myappdir,baba2);
  28.     sprintf(thestrdata, "%s\\overloader extbuzz.dll", myappdir);
  29.     HMODULE h_dll=LoadLibrary(thestrdata);
  30.     if(h_dll==NULL) {
  31.         library_loaded = 0;
  32.         // Loading OEB failed
  33.     } else {
  34.         library_loaded = 1;
  35.         oeblib_GetVersion=(char *(__cdecl *)(void))GetProcAddress(h_dll,"OEBGetVersionText");
  36.         oeblib_SetSongInfoMac=(void (__cdecl *)(CSongInfoHandler *))GetProcAddress(h_dll,"OEBSetSongInfo");
  37.         oeblib_GetSongInfoMac=(CSongInfoHandler *(__cdecl *)(void))GetProcAddress(h_dll,"OEBGetSongInfo");
  38.         oeblib_GetMainBuzzWindow=(HWND (__cdecl *)(void))GetProcAddress(h_dll,"OEBGetMainBuzzWindow");
  39.         oeblib_SetpCB=(void (__cdecl *)(void *))GetProcAddress(h_dll,"OEBSetpCB");
  40.         oeblib_GetpCB=(void *(__cdecl *)(void))GetProcAddress(h_dll,"OEBGetpCB");
  41.     }
  42. }
  43. void OEBSongInfo_Unload() { if (library_loaded == 1) { oeblib_SetSongInfoMac(NULL); } }
  44. void OEBSongInfo_Load(CSongInfoHandler *buf) { if (library_loaded == 1) { oeblib_SetSongInfoMac(buf); } }
  45. HWND OEBSongInfo_GetBuzzWindow(void *pp) { HWND buf; if (library_loaded == 1) { oeblib_SetpCB(pp); buf = oeblib_GetMainBuzzWindow(); } else { buf = GetForegroundWindow(); } return buf; }
  46. /////////////////////////////////////////////////////////////////
  47. // End of SongInfo OEB Stuff
  48. /////////////////////////////////////////////////////////////////
  49.